﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EFFC.Net.Data.Base;

namespace EFFC.Net.Returns
{
    [Serializable]
    public class WebLogicCheckRtn : ReturnStd
    {
        public WebLogicCheckRtn()
        {
            this.AddReElement("IsSuccess", typeof(bool));
            this.AddReElement("AlertMessage");
            this.AddReElement("ConfirmMessage");
        }
        public string AlertMessage
        {
            get
            {
                return this.GetValue<string>("AlertMessage");
            }
            set
            {
                _p["AlertMessage"].Value = value;
            }

        }
        public string ConfirmMessage
        {
            get
            {
                return this.GetValue<string>("ConfirmMessage");
            }
            set
            {
                _p["ConfirmMessage"].Value = value;
            }

        }
        public bool IsSuccess
        {
            get
            {
                return this.GetValue<bool>("IsSuccess");
            }
            set
            {
                _p["IsSuccess"].Value = value;
            }
        }
        /// <summary>
        /// 除已定义属性外，如需要返回别的数据则调用该方法
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public void SetElement(string key, object value)
        {
            if (_p.ContainsKey(key))
            {
                _p[key].Value = value;
            }
            else
            {
                AddReElement(key, value.GetType());
                _p[key].Value = value;
            }
        }
    }
}
